package structurePattern.facadePattern;

import java.util.HashMap;

public class QueryAPI {

	private HashMap<Integer, Integer> idPriorityMap = new HashMap<>();

	private static QueryAPI queryAPI = new QueryAPI();

	private QueryAPI() {
	}

	public static QueryAPI getQueryAPI() {
		return queryAPI;
	}

	public int getPriority(Integer id) {
		Integer pri = idPriorityMap.get(id);
		if (pri == null) {
			return 0;
		} else {
			return pri;
		}
	}

	public void updatePriority(int id, int priority) {
		idPriorityMap.put(id, priority);
	}

}
